package com.cn.study0011.Test003;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName Results.java
 * @Description
 * @createTime 2023年05月16日 17:11:00
 */
public class Results {
    public int sum(int s1,int s2,int s3){
        int s=s1+s2+s3;
        return s;
    }
    public double avg(int s1,int s2,int s3){
        int a1=sum(s1, s2, s3);
        double d= a1/3.0;
        return d;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        Results results=new Results();
        System.out.print("请输入Java的成绩：");
        int  Java=sc.nextInt();
        System.out.print("请输入C#的成绩：");
        int  C =sc.nextInt();
        System.out.print("请输入DB的成绩：");
        int  DB=sc.nextInt();
        int totalGrade=results.sum(Java, C, DB);
        double avg=results.avg(Java, C, DB);
        System.out.println("总成绩："+totalGrade);
        System.out.println("平均成绩："+avg);

    }
}
